{include file='_header'}
<title>商品详情</title>
<link rel="stylesheet" href="/public/static/plugin/groups/css/style.css?v=2018531" />
<style type="text/css">
	.creditshop-detail-page .fui-navbar .abtn{height:2.6rem;width:40%;font-size:12px;-webkit-border-radius: 0;border-radius: 0;padding:0.5rem 0 0 0;display: block;float:left;
		line-height: 0.8rem;}
	.creditshop-detail-page .fui-navbar .homeabtn{height:2.6rem;width:20%;font-size:12px;-webkit-border-radius: 0;border-radius: 0;margin:0;padding:0;display: block;float:left;background: #fff;
		color:#666;border:none;line-height: 2.6rem;}
	.homeabtn .icon{font-size:1rem;}
	.text-danger span{color:#ef4f4f;font-size:1rem;}
	.lynn_goods_head_title i{
		font-style: normal;
		font-size: 0.55rem;
		color: #999;
		text-align: right;
		margin-left: 0.5rem;
	}
</style>
<script  language='javascript'>
    function getHeight (obj){
        var w = obj.width;
        var h = obj.height;
        console.error('h:'+ h +'     w:'+w)
        var height = ((750*h) / w) / 40 + 'rem';
        $('.fui-swipe').css('height', height );
        $('.fui-swipe .fui-swipe-wrapper .fui-swipe-item img').css('height', height);
    }
</script>


<div class='fui-page creditshop-detail-page'>
	<a href="{:url('order')}" class="iconfont icon lynn_back_icon back">&#xe755;</a>
	<div class='fui-content'>


		{if !is_mobile()}<div class="pcshop-index">{/if}


		<div class="fui-swipe" data-speed="5000" data-gap="5" style="height: 0;">


			<div class="fui-swipe-wrapper">


				{foreach name="goods['thumb_url']" key='index' item='thumb'}


				<div class="fui-swipe-item">


					{if $index == "0" }


					<img src="{:tomedia($thumb)}" onload="getHeight(this)" alt="{$goods['title']}" onerror="this.src='/public/static/images/nopic100.jpg'">


					{else}


					<img src="{:tomedia($thumb)}" alt="{$goods['title']}" onerror="this.src='/public/static/images/nopic100.jpg'">


					{/if}


				</div>


				{/foreach}


			</div>


			<div class="fui-swipe-page">


				{foreach name="goods['thumb_url']" item='thumb'}


				<div class="fui-swipe-bullet"></div>


				{/foreach}


			</div>


		</div>


		<div class="lynn_goods_head">


			<h2 class="lynn_goods_head_title" style="font-size: 0.7rem;">{if $goods['is_ladder'] ==1}<span>阶梯团</span>{else}<span>{$goods['groupnum']}人团</span>{/if} {$goods['title']}<br> <i>{$goods['description']}</i></h2>


			<span class="lynn_goods_follow" style="display: none;">


				<i class="iconfont icon">&#xe606;</i><i class="iconfont icon on">&#xe605;</i>收藏


			</span>





			<div class="subtitle">


				已有<b>{$goods['fightnum']}</b>人参团，销量<b>{$goods['sales']}</b>


			</div>


			<div class="price">


				<strong>¥ {$goods['groupsprice']}/{if $goods['units']}{$goods['goodsnum']}{$goods['units']}{else}1件{/if}</strong> <del>原价¥ {$goods['price']}</del>


			</div>


			{if !empty($goods['isdiscount']) && !empty($goods['discount']) && !empty($groupsset['discount'])}


			<div class="lynn_goods_discount" style="color: #333">


				<i class="icon icon-gengduocopy" style="color: #ff5555;font-size: 0.8rem;margin-right: 0.2rem;"></i>团长优惠 <span style="color: #ff5555">{if $goods['headstype']==0} ¥{$goods['headsmoney']}{elseif $goods['headstype']==1}{:(number_format($goods['headsdiscount'] / 10,1))}折{/if}</span>


			</div>


			{/if}


			{if !empty($goods['isdiscount']) && empty($goods['discount']) && !empty($groupsset['discount'])}


			<div class="lynn_goods_discount" style="color: #333">


				团长优惠 <span style="color: #ff5555">{if $groupsset['headstype']==0} ¥{$groupsset['headsmoney']}{elseif $groupsset['headstype']==1}{:(number_format($groupsset['headsdiscount'] / 10,1))}折{/if}</span>


			</div>


			{/if}


		</div>





		<div class="lynn_goods_invitation">


			<div class="invitation-title">拼团玩法</div>


			<div class="fui-cell-group" style="margin-top: 0">


				<a href="{:url('mobile/groups/rules')}" class="fui-cell" style="text-decoration:none;padding: 0.4rem 0.6rem 0.45rem 0;">


					<div class="fui-cell-info" style="color: #999;font-size: 0.65rem;">开团并邀请好友参团，人数不足自动退款</div>


					<div class="fui-cell-remark"></div>


				</a>


			</div>


		</div>


		<div class="lynn_goods_content">


			<div class="lynn_goods_content_title"><span>图文详情</span></div>


			<div class="lynn_goods_content_info content-images" id="content">


				{if $groupsset['description']}


				{:htmlspecialchars_decode($groupsset['groups_description'])}


				{else}


				{:htmlspecialchars_decode($goods['content'])}


				{/if}


			</div>


		</div>


		<div style="height:2.5rem;"></div>


		{if !is_mobile()}</div>{/if}


	</div>


	<div class="fui-navbar bordert" style="z-index:100;padding:0;display: flex;-webkit-flex: 1">


		<a class="homeabtn btn btn-warning {if empty($goods['stock'])}disabled{/if} external" style="padding-top: 0.3rem" href="{:url('mobile/groups/index')}">


			<p class="icon icon-home1" style="line-height: 1rem"></p>


			<p style="line-height: 1rem">拼团首页</p>


		</a>


		{if $goods['single']}


		<a class="lynn_goods_btn lynn_btn_waring btn-single" href="javascript:void(0);">


			<p>{if $goods['single']}¥ <strong>{$goods['singleprice']}</strong>{else}<br />{/if}</p> 单独购买


		</a>


		{/if}


		<a class="lynn_goods_btn lynn_btn_danger" data-nocache="true" href="{:url('mobile/groups/openGroups',array('id'=>$goods['id'],'is_ladder'=>$goods['is_ladder'],'more_spec'=>$goods['more_spec']))}">


			{if $goods['is_ladder'] ==1}


			<p style="margin-top: 10px"><strong>参加阶梯团</strong></p>


			{elseif $goods['more_spec'] ==1}


			<p>¥ <strong>{$goods['groupsprice']}</strong></p> {$goods['groupnum']}人成团


			{else}


			<p>¥ <strong>{$goods['groupsprice']}</strong></p> {$goods['groupnum']}人成团


			{/if}


		</a>


	</div>


	<div class='layer'style="display: none" ></div>


	<!--多规格弹窗  -->
	<div class='fui-modal goods-picker in goodslist' style="display: none">
		<div class='option-picker'>
			<div class='option-picker-inner'>
				<div class='fui-list'>
					<div class='fui-list-media'>
						<image class='thumb' src={$goods['thumb']}></image>
					</div>
					<div class='fui-list-inner'>
						<div class='subtitle'>{$goods['title']}</div>
						<div class='price'>{$goods['groupsprice']}</div>
						<div class='option_id'style="display: none" ></div>
					</div>
				</div>
				<div class='option-picker-options'>
					<div class='option-picker-cell option spec'>
					</div>
				</div>
			</div>
			<div class='sure'><div class='btn btn-danger block'>确定</div></div>
		</div>
		<div class='icon icon-guanbi1' style='color:#fff;text-align:center;font-size:1.25rem;margin-top:0.75rem;' bindtap='emptyActive'> </div>
	</div>
</div>
<script language='javascript'>
    require(['/public/static/plugin/groups/js/goods.js'], function (modal) {
        modal.init({$goods['id']},{$goods['more_spec']});
    });
</script>
{include file='_footer'}